<?php

namespace mpend\modules\activity\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\activity\models\ActivitySearch;
use mpend\modules\activity\models\ActivityView;

/**
 * 活动
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DefaultController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * @inheritdoc
     */
    public function actionIndex() {
        $model = new ActivitySearch();
        return $model->search(Yii::$app->request->getQueryParams());
    }

    /**
     * {@inheritdoc}
     */
    public function actions() {
        return [
            'view' => [
                'class' => 'yii\rest\ViewAction',
                'modelClass' => ActivityView::class,
            ],
        ];
    }

}
